package com.dongwu.manager.dao;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.dongwu.common.dao.BaseDao;
import com.dongwu.manager.entity.AppTemplate;

import java.util.List;

@Repository
public interface AppTemplateDao  extends BaseDao<AppTemplate, String> {

    List<AppTemplate> findByStatusAndShowType(Integer status,Integer showType);

//    List<AppTemplate> findByStatusAndShowTypeAndUserId(Integer status,Integer showType,String userId);

    AppTemplate findByShowTypeAndIsDefault(Integer showType,Boolean isDefault);

    @Query(value = "select * from app_template t where t. template_type_id = ?1 limit 0,1", nativeQuery = true)
    AppTemplate getByTemplateTypeList(String templateTypeId);

}
